package edu.pku.sei.mte.compositetrans.flow;

import java.util.Map;

import org.w3c.dom.Element;

public abstract class ActivityNode extends FlowNode {
	private FlowNode next;

	@Override
	public FlowNode getNext() {
		if(isSucceed)
			return next;
		else return FlowController.WRONG_OF_FLOW;
	}

	public void setNext(FlowNode next) {
		this.next = next;
	}
	
	@Override
	public void load(Element e, Map<Integer, FlowNode> FlowNodesMap) {
		next = FlowNodesMap.get(getPostId(e));
		if (next instanceof JoinNode)
			((JoinNode)next).getPreNodes().add(this);
		super.load(e, FlowNodesMap);
	}
}
